<template>
  <div class="xsd-swiper">
    <xsd-swiper-content
      :width="width"
      :imgList="imgList"
      :button="button"
      :dot="dot"
      :canClick="canClick"
      :height="height"
      :autoplay="autoplay"
      @lookImg="lookImg"
    ></xsd-swiper-content>
    <router-view :imgSrc="imgSrc" @close="close"></router-view>
  </div>
</template>

<script type="text/javascript">
import xsdSwiperContent from "./xsd-swiper-content";
import imgView from "./imgView";
import VueRouter from "vue-router";
export default {
  data() {
    return {
      imgSrc: "",
    };
  },
  methods: {
    lookImg(imgSrc) {
      this.imgSrc = imgSrc;
      this.$router.push("/xsd");
    },
    close() {
      this.$router.go(-1);
      const view = document.getElementsByName("viewport");
      view[0].content =
        "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no";
    },
  },

  components: {
    xsdSwiperContent,
    // imgView
  },
  router: new VueRouter({
    routes: [
      {
        path: "/xsd",
        component: imgView,
      },
    ],
  }),
  props: [
    "imgList",
    "width",
    "height",
    "button",
    "dot",
    "autoplay",
    "canClick",
  ],
};
</script>

<style scoped></style>
